<?php
include("../config.php");
function checkLogin($user,$psw,$isAdmin){
	global $prefix;
	if($isAdmin){
		$sql="SELECT * FROM ".$prefix."member WHERE m_username='".$user."' AND m_psw='".md5($psw)."' AND m_isAdmin=1";
		$result=mysql_query($sql);
		if($arr=mysql_fetch_array($result)){
			$_SESSION['admin']=$arr['m_username'];
			if($arr['m_isSuperAdmin']){$_SESSION['super']=true;}
		}
	}else{
		$sql="select * from ".$prefix."member where m_username=".$user." and m_psw='".md5($psw)."'";
		$result=mysql_query($sql);
		$_SESSION['user']=$result['m_username'];
	}
}
?>